package com.scetop.bank;

import java.util.ArrayList;
import java.util.Iterator;

public class Customer {
    private String firstName;
    private String lastName;
    private Account account;

//    private Account [] accounts;
//    private int numOfAccounts;

    private ArrayList<Account> accounts;

    private SavingsAccount savingsAccount;
    private CheckingAccount checkingAccount;

    public Customer(String f, String l) {
        this.firstName = f;
        this.lastName = l;

        accounts = new ArrayList<>();
    }
    public String getFirstName() {
        return firstName;
    }
    public String getLastName() {
        return lastName;
    }
    public Account getAccount() {
        return account;
    }
    public void setAccount(Account account) {
        this.account = account;
    }

    public void addAccount(Account account) {
//        accounts[numOfAccounts++] = account;
        accounts.add(account);
    }

    public Account getAccount(int inedx) {
//        return accounts[inedx];
        return  accounts.get(inedx);
    }

    public int getNumOfAccounts() {
//        return numOfAccounts;
        return accounts.size();
    }

    public Iterator<Account> getAccounts() {
        return accounts.iterator();
    }


    public SavingsAccount getSavingsAccount() {
        return savingsAccount;
    }

    public void setSavingsAccount(SavingsAccount savingsAccount) {
        this.savingsAccount = savingsAccount;
    }

    public Account getCheckingAccount() {
        return checkingAccount;
    }
    public void setCheckingAccount(CheckingAccount checkingAccount) {
        this.checkingAccount = checkingAccount;
    }
}

